package com.kai.steering.data.service.service;

import com.kai.steering.common.vo.Result;
import com.kai.steering.data.service.entity.domainObject.KnowledgeDO;
import com.kai.steering.data.service.entity.dto.KnowledgeQueryDTO;
import com.kai.steering.data.service.entity.po.Knowledge;
import com.kai.steering.common.web.service.BaseService;
import com.kai.steering.common.vo.Page;
import com.kai.steering.data.service.entity.vo.KnowledgeVO;

import java.io.Serializable;
import java.util.List;

/**
 * <pre>
 * 知识点 服务类
 * </pre>
 *
 * @author kai
 * @since 2022-02-23
 */
public interface KnowledgeService extends BaseService<Knowledge> {

    /**
     * 保存
     *
     * @param knowledgeDO
     * @return
     */
    boolean saveKnowledge(KnowledgeDO knowledgeDO);

    /**
     * 修改
     *
     * @param knowledgeDO
     * @return
     */
    boolean updateKnowledge(Serializable id, KnowledgeDO knowledgeDO);

    /**
     * 删除
     *
     * @param id
     * @return
     */
    boolean deleteKnowledge(Serializable id);


    /**
     * 获取所有对象
     *
     * @return
     */
    List<KnowledgeDO> getAllKnowledge();

    /**
     * 获取分页对象
     *
     * @param knowledgeQueryDTO
     * @return
     */
    Page<KnowledgeVO> getKnowledgePageList(KnowledgeQueryDTO knowledgeQueryDTO);

    /**
     * 判断某属性是否存在
     *
     * @param key
     * @param val
     * @param id
     * @return
     */
    boolean isExists(String key, String val, Serializable id);

    public boolean isAllExists(List<KnowledgeDO> knowledgeDOS);
        /**
         * 获取知识点
         *
         * @param knowledgeId
         * @return
         */
    KnowledgeDO getKnowledgeById(String knowledgeId);

    /**
     * 根据name获取知识点
     *
     * @param name
     * @return
     */
    KnowledgeDO getKnowledgeByName(String name);

    KnowledgeDO treeKnowledge(String id);

    /**
     * id集合查询
     * @param collect
     * @return
     */
    List<KnowledgeDO> getKnowledgeByIds(List<String> collect);

    boolean checkKnowledgeChange( List<KnowledgeDO> knowledgeDOs,List<KnowledgeDO> oldKnowledgeDOs);
}

